<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<% if (session.getAttribute("sUsuario") != null) {
        response.sendRedirect(getServletContext().getContextPath());
    }
    response.addHeader("Cache-Control", "max-age = 0, s-maxage = 0,must-revalidate, proxy-revalidate, no-cache, no-store ");
    response.addHeader("Pragma", "no-cache");%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="author" content="Moises Canche Tzab - Sybil Integraciones TI">
        <link rel="shortcut icon" href="images/favicon.ico">
        <title>SSYMA - Login</title>
        <style type="text/css">
            #login_div {
                position: absolute;
                top: 20%;
                left: 30%;
                padding: 5%;
                margin: 5%;
                border: solid thin green;
                background-color: #EEEEEE;
            }
        </style>
        <script type="text/javascript">
            function enfocar() {
                document.getElementById("login").focus();
            }
            function validar() {
                if (document.getElementById("login").value.length < 3 ) {
                    alert("Introduce tu usuario");
                    document.getElementById("login").focus();
                    return false;
                }
                if (document.getElementById("pass").value.length < 3) {
                    alert("Ingresa tu Contrasena");
                    document.getElementById("pass").focus();
                    return false;
                }
                return true;
            }
        </script>
    </head>
    <body onload="enfocar();">
        <div id="login_div">
            <form name="form1" method="post" action="usuario" onsubmit="return validar();">
                <input type="hidden" name="ac" value="lg">
                <table border="0">
                    <tr>
                        <td><strong>Usuario:</strong></td>
                        <td><input type="text" name="login" id="login"/></td>
                    </tr>
                    <tr>
                        <td><strong>Contrase&ntilde;a:</strong></td>
                        <td><input type="password" name="contrasena" id="pass"/></td>
                    </tr>
                    <tr>
                        <td align="right" colspan="2">
                            <input type="submit" value="Entrar"/>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </body>
</html>